{  Statement: http://acmp.ru/?main=task&id_task=493
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    i,j,n,m,ans:longint;
    a:array[0..110,0..110] of boolean;
    ch:char;

begin
reset(input,'input.txt');
rewrite(output,'output.txt');
fillchar(a,sizeof(a),0);
readln(n, m);
for i := 1 to n do begin
    for j := 1 to m do begin
        read(ch);
        a[i][j] := ch = '*';
    end;
    readln;
end;
ans := 0;
for i:=1 to n do
    for j:=1 to m do
        if not(a[i][j] or a[i - 1][j] or a[i][j - 1] or a[i][j + 1] or a[i + 1][j]) then inc(ans);
write(ans);
end.
